package com.zzg.springboot.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.zzg.springboot.dao.UserEntityDao;
import com.zzg.springboot.entity.UserEntity;

@Service
public class UserEntityService {
	@Autowired
	private UserEntityDao dao;
	
	public void init(){
		for(int i=0; i < 10; i++){
			UserEntity entity = new UserEntity("name-"+1,"pwd-"+i,"address-"+i);
			dao.save(entity);
		}
	}
	
	public UserEntity findByName(String name){
		return dao.findByName(name);
	}
	
}
